-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server: fix insert zero timestamp bug with prepared statement #7506
Conversation
/run-all-tests |
server/conn_stmt.go
Outdated
@@ -354,7 +354,7 @@ func parseStmtArgs(args []interface{}, boundParams [][]byte, nullBitmap, paramTy | |||
pos++ | |||
switch length { | |||
case 0: | |||
args[i] = "0" | |||
args[i] = "00000000000000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a constant.
server/conn_stmt_test.go
Outdated
@@ -120,7 +120,7 @@ func (ts ConnTestSuite) TestParseStmtArgs(c *C) { | |||
[]byte{0x00}, | |||
}, | |||
nil, | |||
"0", | |||
"00000000000000", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Why not add a case for |
@jackysp we don't modify that, I think modified ut cover first half part, and add a second half part integration test using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
What problem does this PR solve?
fixes #7501
What is changed and how it works?
in protocol layer return
"types.ZeroDatetimeStr"
instead of"0"
to make latertypes.parseDatetime
happy.Check List
Tests
Code changes
Side effects
Related changes
This change is